/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package tankproject;

import java.awt.Color;
import java.awt.Dimension;
import java.awt.Graphics;
import java.awt.Graphics2D;
import java.awt.Image;
import java.awt.event.KeyEvent;
import java.awt.event.KeyListener;
import java.awt.event.MouseEvent;
import java.awt.event.MouseListener;
import java.awt.event.MouseMotionListener;
import java.awt.geom.AffineTransform;
import java.util.Timer;
import java.util.TimerTask;
import javax.swing.JFrame;

/**
 *
 * @author Harry
 */
public class Main {

    /**
     * @param args the command line arguments
     */
    public static void main(String[] args) {
        // TODO code application logic here
        TankController controller = new TankController();
        Tank tank = new Tank();
        Turret turret = new Turret();
        final TankView view = new TankView(tank, turret, controller);
        controller.setTank(tank);
        controller.setTurret(turret);
        controller.setView(view);

        Timer timer = new Timer();
        TimerTask task = new TimerTask() {

            @Override
            public void run() {
                view.repaint();
            }
        };

        int fps = 60;
        timer.scheduleAtFixedRate(task, 0, 1000 / fps);
        view.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
        view.setSize(new Dimension(800, 600));
        view.setTitle("Copyright © <RHMA>, 2011");
        view.setVisible(true);

    }
}
